<template>
  <div class="overview">
    <div
      class="item"
      v-for="item in data"
      :style="{ background: item.style?.background, color: item.style?.color }"
    >
      <div class="item-icon">
        <i class="fa" :class="item.style?.icon"></i>
      </div>
      <div class="item-value">{{ item.value }}</div>
      <div class="item-label">{{ item.label }}</div>
    </div>
  </div>
</template>
<script setup>
const props = defineProps({
  data: Array,
})
</script>
<style lang="scss" scoped>
.overview {
  display: grid;
  // grid-template-columns: repeat(auto-fill, minmax(25%, 1fr));
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

  gap: 16px;
  margin-bottom: 16px;
}

.item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px 0;

  background: white;
  border-radius: calc(var(--border-radius) - 4px);
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}

.item-icon {
  font-size: 32px;
}

.item-value {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 8px;
}

.item-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
</style>
